package mithrilwings.scenario.controller;

import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.util.CollisionShapeFactory;
import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;
import fifis.base.controller.BController;
import mithrilwings.scenario.model.MithrilWingsScenarioModel;
import mithrilwings.scenario.view.MithrilWingsScenarioView;
import org.apache.log4j.Logger;

/**
 *
 * @author porfiriopartida
 */
public class MithrilWingsScenarioController extends BController {
    final static protected Logger log4j = Logger.getLogger(MithrilWingsScenarioController.class);
    public MithrilWingsScenarioController(String scene) {
        MithrilWingsScenarioModel model = new MithrilWingsScenarioModel(scene);
        MithrilWingsScenarioView view = new MithrilWingsScenarioView(model);
        setModel(model);
        setView(view);

        createRigidControl(Vector3f.ZERO, 0);
    }

    @Override
    public boolean isAlive() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    @Override
    public CollisionShape getRigidCollisionShape() {
        Spatial sceneModel = getNode().getChild("terrain");
        return CollisionShapeFactory.createMeshShape(sceneModel);
    }

    @Override
    public void update() {
    }

    @Override
    public CollisionShape getCharacterCollisionShape() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public CollisionShape getGhostCollisionShape() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
